package cn.concurrence;

import java.util.concurrent.TimeUnit;

/**
 * @author summit
 * @since 2022/4/19 17:10
 */
public class SynchroTest1 {

	private Integer a = 0;

	synchronized void addOne() {
		a += 1;
		try {
			TimeUnit.MILLISECONDS.sleep(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

	}

	public Integer getA() {
		return a;
	}
}
